<div class="row">
  <div class="col-md-8">
    <h4>Cadastro de notícias</h4>

    <% if can? :create, WebAdmin::Post %>
      <div class="row">
        <div class="col-md-12"><%= link_to 'Nova', new_post_path, class: 'btn btn-primary link-new' %></div>
      </div>
    <% end %>

    <div class="table-responsive">
      <table class="table table-hover">
        <thead>
          <tr>
            <td>Título</td>
            <td>Criado por</td>
            <td>Criado em</td>
          </tr>
        </thead>

        <tbody>
          <% @posts.each do |post| %>
            <tr>
              <td><%= link_to post.title, edit_post_path(post) %></td>
              <td><%= post.user %></td>
              <td><%= I18n.l post.created_at, format: :only_date %></td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>

  <div class="col-md-4 box">
    <h4>Pesquisa</h4>
  </div>
</div>
